package com.xinsmartsky.penmaji.penmaji;

import android.app.Activity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.PopupWindow;

public class DateAndTimeActivity extends Activity {
    private View dateandtime_rela_01;
    private PopupWindow popupWindow;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_date_and_time);
        FindViewById();
        setOnClickListener();
        //加载页面 弹出pop提示
        initPopupWindow();
        show();

    }

    public void show() {
        dateandtime_rela_01.post(new Runnable() {
            @Override
            public void run() {
                if (popupWindow != null) {
                    popupWindow.showAtLocation(dateandtime_rela_01, Gravity.BOTTOM, 0, 0);
                }
            }
        });
    }

    private void FindViewById() {
        dateandtime_rela_01 = findViewById(R.id.dateandtime_rela_01);

    }

    private void setOnClickListener() {

    }

    private void initPopupWindow() {
        View contentView = getLayoutInflater().inflate(R.layout.activity_digit_english_menu, null);
//        Button cmenu_btn_yes = (Button) contentView.findViewById(R.id.cmenu_btn_yes);
//        Button cmenu_btn_no = (Button) contentView.findViewById(R.id.cmenu_btn_no);
//        cmenu_btn_yes.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//
//            }
//        });
//        cmenu_btn_no.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                if (popupWindow.isShowing()) {
//                    popupWindow.dismiss();
//                }
//            }
//        });
//        popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
//        popupWindow.setOutsideTouchable(false);
//        popupWindow.setFocusable(true);
//        popupWindow.setAnimationStyle(R.style.popupanimation);
    }
}
